<?php 
$section = 'user';
$link = 'user/form/';
?>
<script type="text/javascript">
    /*function validate()
	{
        var email = document.getElementById('email');
        var form = document.getElementById('user_form');
        
        if(isEmptyTextBox(email, '<?php echo Yii::t('user','_MSG_EMAIL_IS_EMPTY'); ?>'))
        {
            return false;
        }
        
        if(email.value.length > '<?php echo MAX_LENGTH_NAME; ?>')
        {
            showErrorBubble(email, '<?php echo Yii::t('user','_MSG_EMAIL_IS_TOO_LONG'); ?>');
            return false;
        }
        
        var agr = new Array();
        agr.push(trim(email.value));
        agr.push('<?php echo $model->id;?>');

        if(callFunction("UserComponent::isExistByEmail", agr)!='0')
        {
            showErrorBubble(email, '<?php echo Yii::t('user','_MSG_EMAIL_ALREADY_EXISTS'); ?>');
            return false;
        }
        
        form.submit();
	}
*/
</script>
<div class="panel-admin">
    <h1><?php if ($model->id) { echo Yii::t('user','_LB_EDIT_USER');} else {echo Yii::t('user','_LB_ADD_USER');}?></h1>
    <div class="form-admin">
        <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'user_form',
            'enableClientValidation'=>true,
            'clientOptions'=>array(
                'validateOnSubmit'=>false,
            ),
            'focus'=>array($model,'email'),
        )); ?>
            <table>
                <tr>
                    <td><?php echo $form->labelEx($model,'email'); ?></td>
                    <td>
                        <?php echo $form->textField($model,'email', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'email', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo $form->labelEx($model,'pass'); ?></td>
                    <td>
                        <?php echo $form->passwordField($model,'pass', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'pass', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo Yii::t('user','_LB_CONFIRM_PASSWORD'); ?></td>
                    <td><input id="confirmpass" name="confirmpass" type="password" class="textbox-admin"> </td>
                </tr>
                <tr>
                    <td><?php echo $form->labelEx($model,'first_name'); ?></td>
                    <td>
                        <?php echo $form->textField($model,'first_name', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'first_name', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo $form->labelEx($model,'last_name'); ?></td>
                    <td>
                        <?php echo $form->textField($model,'last_name', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'last_name', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo $form->labelEx($model,'birthday'); ?></td>
                    <td>
                        <?php echo $form->textField($model,'birthday', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'birthday', array('class'=>'error')); ?>
                    </td>
                </tr>

                <tr>
                    <td><?php echo $form->labelEx($model,'sex'); ?></td>
                    <td>
                        <?php echo $form->radioButtonList($model,'sex',array('1'=>Yii::t('user','_LB_SEX_MALE'), '2'=>Yii::t('user','_LB_SEX_FEMALE')),array('separator'=>' '));?>
                        <?php echo $form->error($model,'sex', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo $form->labelEx($model,'mobile'); ?></td>
                    <td>
                        <?php echo $form->textField($model,'mobile', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'mobile', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo $form->labelEx($model,'active'); ?></td>
                    <td>
                        <?php echo $form->checkBox($model,'active', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'active', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo $form->labelEx($model,'group_id'); ?></td>
                    <td>
                        <?php echo $form->dropDownList($model,'group_id', $groups, array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'group_id', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo $form->labelEx($model,'note'); ?></td>
                    <td>
                        <?php echo $form->textField($model,'note', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'note', array('class'=>'error')); ?>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <?php echo CHtml::submitButton(Yii::t('common','_LB_SAVE'), array("class"=>"button-admin")); ?></td>
                </tr>
            </table>
        <?php $this->endWidget(); ?>
    </div>
</div>